import type { RouteRecordRaw } from 'vue-router'

function Layout() {
  return import('@/layouts/index.vue')
}

const routes: RouteRecordRaw = {
  path: '/drawact',
  component: Layout,
  redirect: '/drawact/index',
  name: 'drawact',
  meta: {
    title: '抽奖活动',
    icon: 'lucide-lab:wheel',
  },
  children: [
    {
      path: 'index',
      name: 'drawactIndex',
      component: () => import('@/views/drawact/index.vue'),
      meta: {
        title: '活动配置',
      },
    },
    {
      path: 'detail',
      name: 'drawactDetail',
      component: () => import('@/views/drawact/detail.vue'),
      meta: {
        title: '活动配置',
        menu: false,
        activeMenu: '/drawact/index',
      },
    },
    {
      path: 'drawactprizeIndex',
      name: 'drawactprizeIndex',
      component: () => import('@/views/drawactprize/index.vue'),
      meta: {
        title: '活动奖品配置',
      },
    },
    {
      path: 'drawactprizeDetail',
      name: 'drawactprizeDetail',
      component: () => import('@/views/drawactprize/detail.vue'),
      meta: {
        title: '活动奖品配置',
        auth: ['permission.browse'],
        menu: false,
        activeMenu: '/drawact/drawactprizeIndex',
      },
    },
    {
      path: 'Record',
      name: 'drawactRecord',
      component: () => import('@/views/drawact/record.vue'),
      meta: {
        title: '抽奖记录',
      },
    },
    {
      path: 'userIndex',
      name: 'drawactuserIndex',
      component: () => import('@/views/drawactuser/index.vue'),
      meta: {
        title: '活动用户',
      },
    },
    {
      path: 'userDetail',
      name: 'drawactuserDetail',
      component: () => import('@/views/drawactuser/detail.vue'),
      meta: {
        title: '活动用户详情',
        menu: false,
        activeMenu: '/drawact/userIndex',
      },
    },
  ],
}

export default routes
